package marsdonne.demo4springData.validators;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class SqlValidatorCheck implements ConstraintValidator<SqlValidator, String> {
    private String sql;

    @Override
    public void initialize(SqlValidator constraint) {
        this.sql = constraint.value();
    }

    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        return value.equalsIgnoreCase(sql);
    }
}
